import { Request } from '@/plugins/supplier-request'
import { PENDING_APPROVAL_PATH } from './../constans'

// 供应商管理 - 供应商待审批 - 列表查询
export const queryPendingApprovalListService = (data) => {
  return Request(`${PENDING_APPROVAL_PATH}/list`, 'post', data)
}

// 供应商管理 - 供应商待审批 - 取回
export const withdrawPendingApprovalService = (data) => {
  return Request(`${PENDING_APPROVAL_PATH}/withdraw`, 'post', data)
}

// 供应商管理 - 供应商待审批 - 删除暂存
export const deleteStagingService = (data) => {
  return Request(`${PENDING_APPROVAL_PATH}/process-document?id=${data.id}`, 'delete')
}

// 供应商管理 - 供应商待审批 - 根据审批流id, 查询暂存的供应商
export const queryStageSupplierDetail = (data) => {
  return Request(`${PENDING_APPROVAL_PATH}/query-stage-supplier-detail`, 'get', data)
}

// 供应商管理 - 供应商待审批 - 根据审批流id, 查询审批页面的业务对接人详情
export const queryBusinessDetail = (data) => {
  return Request(`${PENDING_APPROVAL_PATH}/query-business-detail`, 'get', data)
}

// 供应商管理 - 根据 审批流请求id, 查询待审批的供应商详情（带新旧对比字段）
export const queryApprovalSupplierDetail = (data) => {
  return Request(`${PENDING_APPROVAL_PATH}/query-approval-supplier-detail`, 'get', data)
}
